import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import React, { useEffect } from 'react';
import Header from './components/Header';
import navigationTool from './utilities/navigationTool';
import { TabbarManagerEmitter } from './utilities/tabbarManager';
const App = () => {
    useEffect(() => {
        const listener = TabbarManagerEmitter.addListener(
            'Tabbarchanged',
            (p) => {
                console.log(p);
            }
        );
        return () => {
            listener?.remove();
        };
    }, []);
    return (
        <View style={styles.wrapper}>
            <Header title="商城" />
            <Text>EzMallIndex</Text>
            <TouchableOpacity
                onPress={() => {
                    navigationTool.startBiz('EzMallDetails', 'index', {
                        id: 12345,
                    });
                }}
                activeOpacity={1}
                style={styles.btnWrapper}>
                <Text>详情</Text>
            </TouchableOpacity>
        </View>
    );
};

export default App;

const styles = StyleSheet.create({
    wrapper: {
        flex: 1,
    },
    btnWrapper: {
        width: 100,
        height: 100,
        justifyContent: 'center',
        alignItems: 'center',
    },
});
